package com.iflytek.day11._01_StaticProp;

public class StudentTest {

  public static void main(String[] args) {
    // 创建对象
    Student stu1 = new Student();
    Student stu2 = new Student();

    stu1.name = "徐峥";
    stu2.name = "黄渤";
    // Student.sleep();// 报错，必须用对象访问。
    stu1.sleep();
    stu1.run();

    stu2.sleep();
    stu2.run();
    // 静态方法，使用类调用
    Student.schoolName = "郑州大学";
    Student.study();

    // 修改完schoolName属性之后，所有对象的schoolName值都变了
    stu1.sleep();
    stu2.sleep();
  }
}